	<!-- BEGIN header -->
	<include file="public:header" />
	<!-- END header -->

	<!-- BEGIN CONTAINER -->

	<div class="page-container row-fluid">
		{$left_menu}
		<!-- BEGIN PAGE -->

		<div class="page-content">

			

			<!-- BEGIN PAGE CONTAINER-->        

			<div class="container-fluid">

				<!-- BEGIN PAGE HEADER-->

				<div class="row-fluid">

					<div class="span12">

						<!-- BEGIN STYLE CUSTOMIZER -->

						<!-- END BEGIN STYLE CUSTOMIZER -->  

						<!-- BEGIN PAGE TITLE & BREADCRUMB-->
						<include file="public:breadcrumb" />
						<!-- END PAGE TITLE & BREADCRUMB-->
						
						<!-- BEGIN sub_menu -->
						<include file="public:sub_menu" />
						<!-- END sub_menu -->

					</div>

				</div>

				<!-- END PAGE HEADER-->

				<!-- BEGIN PAGE CONTENT-->
				<div class="row-fluid">

					<div class="span12">

						<!-- BEGIN VALIDATION STATES-->

						<div class="portlet box blue">

							<div class="portlet-title">

								<div class="caption"><i class="icon-reorder"></i>讲座信息</div>

								<div class="tools">

									<a href="javascript:;" class="collapse"></a>

								</div>

							</div>

							<div class="portlet-body form">

								<!-- BEGIN FORM-->

								<form action="" method="post" id="form_sample_1" class="form-horizontal" novalidate="novalidate">
									
									<div class="control-group">

										<label class="control-label">所属大类</label>

										<div class="controls">

											<select class="span6 m-wrap" name="pid">
												<option value="0" selected>作为讲座栏目</option>
												{$select_menus}

											</select>

										</div>

									</div>
									
									<div style="display:none">
											<input name="type" value="0" type="radio" <if condition="($info.type eq 0) OR (ACTION_NAME eq 'add')"> checked="checked"</if>>
											<input name="type" value="1" type="radio" <if condition="($info.type eq 1) and (ACTION_NAME eq 'edit')"> checked="checked"</if>>
									</div>
									
									<div class="control-group">

										<label class="control-label">标题</label>

										<div class="controls">

											<input name="title" class="span6 m-wrap" type="text" value="{$info.title}">

										</div>

									</div>
									
									<div class="control-group">

										<label class="control-label">讲师<span class="required">*</span></label>

										<div class="controls">

											<select class="span6 m-wrap tooltips" name="uid"  data-placement="top" data-original-title="请选择讲师">
												<option value="">请选择讲师</option>
												<volist name="daka_user" id="v">
													<option value="{$v.id}" <if condition="$v['id'] eq $info['uid']"> selected</if>>{$v.uname}</option>
												</volist>

											</select>

										</div>

									</div>
									
									<div class="control-group">

										<label class="control-label">课堂文章<span class="required">*</span></label>

										<div class="controls">

											<select class="span6 m-wrap tooltips" name="paper_id"  data-placement="top" data-original-title="请选择文章">
												<option value="">请选择文章</option>
												<volist name="paper" id="v">
													<option value="{$v.id}" <if condition="$v['id'] eq $info['paper_id']"> selected</if>>{$v.title}</option>
												</volist>

											</select>

										</div>

									</div>
									
									<div class="control-group" id="content">

										<label class="control-label">课堂描述<span class="required">*</span></label>

										<div class="controls">

											<input name="content" class="span6 m-wrap" type="text" value="{$info.content}">

										</div>

									</div>
									
									<div class="control-group">

										<label class="control-label">排序</label>

										<div class="controls">

											<input name="ordid" class="span6 m-wrap" type="text"  value="{$info.ordid}">

										</div>

									</div>
									
									
									
									<div class="control-group">

										<label class="control-label">是否启用</label>

										<div class="controls">

											<label class="radio">

											<input name="status" value="1" type="radio" <if condition="($info.status eq 1) OR (ACTION_NAME eq 'add')"> checked="checked"</if>>

											启用

											</label>

											<label class="radio">

											<input name="status" value="0" type="radio" <if condition="($info.status eq 0) and (ACTION_NAME eq 'edit')"> checked="checked"</if>>

											不启用

											</label>

										</div>

									</div>

									<input type="hidden" name="id" value="{$info.id}" />
									<input type="hidden" name="time" value="<php>echo time()</php>" />

									<div class="form-actions">

										<button type="submit" class="btn blue">
											<if condition="(ACTION_NAME eq 'add')">添加</if>
											<if condition="(ACTION_NAME eq 'edit')">编辑</if>
										</button>

										<a href="javascript:history.go(-1)" type="button" class="btn">取消</a>

									</div>

								</form>

								<!-- END FORM-->

							</div>

						</div>

						<!-- END VALIDATION STATES-->

					</div>

				</div>
				

				

				<!-- END PAGE CONTENT-->

			</div>

			<!-- END PAGE CONTAINER-->

		</div>

		<!-- END PAGE -->

	</div>

	<!-- END CONTAINER -->
	
	<!-- BEGIN FOOTER -->
	<include file="public:footer" />
	<!-- END FOOTER -->
	<script>
	
	$('[name="pid"]').change(function(){
		var vl = $(this).val();
		
			var spacer = $('[name="pid"] option[value="'+vl+'"]').attr('data-spacer');
			if(spacer == '' || spacer == undefined){
				//说明选择的是一级
				//那么,这个类型 type = 0;属于单元
				val = 0;
			}else{
				//说明选择的是二级
				//那么,这个类型 type = 1;属于课堂
				val = 1;
			}
		
		//console.log(spacer);
		//console.log(val);
		check_type(val);
		change_type(val);
	});
	function check_type(val){
		$('[name="type"]').removeAttr('checked').parent().removeClass('checked');
		$('[name="type"][value="'+val+'"]').attr('checked','checked').parent().addClass('checked');
	}
	function change_type(val){
		if(val==1){
			$('[name="uid"]').attr('data-required',1).parent().parent().show();
			$('[name="img"]').attr('data-required',1).parent().parent().show();
			$('[name="content"]').attr('data-required',1).parent().parent().show();
			$('[name="paper_id"]').attr('data-required',1).parent().parent().show();
			//$('#container').show();
			//$('.ke-container.ke-container-default').css('width','650px');
		}else{
			$('[name="uid"]').attr('data-required',0).parent().parent().hide();
			$('[name="img"]').attr('data-required',0).parent().parent().hide();
			$('[name="content"]').attr('data-required',0).parent().parent().hide();
			$('[name="paper_id"]').attr('data-required',0).parent().parent().hide();
			//$('#container').hide();
		}
	}
	$('[name="pid"]').change();
	$(function(){
		//check_select();
		//check_type();
		
	}); 
    </script>
	
	
</html>